import request from "@/utils/request"

export function getProductList(categoryId, pageNum, pageSize) {
  return request({
    url: `/products`,
    method: 'get',
    params: {
      categoryId,
      pageNum,
      pageSize
    }
  })
}

/*添加购物车*/
export function addCart(productId) {
  return request({
    url: `/carts  `,
    method: 'POST',
    data: {
      productId,
      selected: true
    }
  })
}

export function getProductInfo(id) {
  return request({
    url: `/products/${id}`,
    method: 'get',
  })
}

